<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>首页</title>
    <link href="/AmazeUI/assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link href="/AmazeUI/assets/css/admin.css" rel="stylesheet" type="text/css"/>
    <link href="/basic/css/demo.css" rel="stylesheet" type="text/css"/>
    <link href="/css/hmstyle.css" rel="stylesheet" type="text/css"/>
    <script src="/AmazeUI/assets/js/jquery.min.js"></script>
    <script src="/AmazeUI/assets/js/amazeui.min.js"></script>
    <script language="JavaScript">
        function search() {
            var index=document.getElementById("searchInput").value;
            if (index.length == 0){
                alert("关键字不能为空！");
                return;
            }else {
                window.location.href="/product/findByIndex/"+index+"/1";
            }
        }
    </script>
</head>

<body>
<div class="hmtop">


    <!--顶部导航条 -->
    <div class="am-container header">
        <ul class="message-l">
            <div class="topMessage">
                <div class="menu-hd" th:if="${session.viper.vip_id == 0}">
                    <a href="/login.html" target="_top" class="h">亲，请登录</a>
                    <a href="/register.html" target="_top">免费注册</a>
                </div>
                <div class="menu-hd" th:if="${session.viper.vip_id != 0}">
                    <b th:if="${session.viper.name != null}"
                       th:text="${session.viper.name}+'('+${session.viper.username}+')'"></b>
                    <b th:if="${session.viper.name == null}" th:text="'null('+${session.viper.username}+')'"></b>
                    <a href="/account/logout" th:text="退出登录"></a>
                </div>
            </div>
        </ul>
        <ul class="message-r">
            <div class="topMessage home">
                <div class="menu-hd"><a href="/index/all" target="_top" class="h">商城首页</a></div>
            </div>
            <div class="topMessage my-shangcheng">
                <div class="menu-hd MyShangcheng"><a href="#" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a>
                </div>
            </div>
            <div class="topMessage mini-cart">
                <div class="menu-hd"><a id="mc-menu-hd" th:href="'/cart/findByVipId/'+${session.viper.vip_id}" target="_top"><i
                        class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum"
                                                                                              class="h">0</strong></a>
                </div>
            </div>
            <div class="topMessage favorite">
                <div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a>
                </div>
            </div>
        </ul>
    </div>

    <!--悬浮搜索框-->

    <div class="nav white">
        <div class="logo"><img src="/images/logo.png"/></div>
        <div class="logoBig">
            <li><img src="/images/logobig.png"/></li>
        </div>

        <div class="search-bar pr">
            <a name="index_none_header_sysc" href="#"></a>
            <form>
                <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
                <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" onclick="search();" type="button">
            </form>
        </div>
    </div>
    <!--悬浮搜索框结束-->
    <div class="clear"></div>
</div>
<!--顶部导航条结束 -->


<div class="listMain">"


    <div class="nav-table">
        <div class="long-title"><span class="all-goods">全部分类</span></div>
        <div class="nav-cont">
            <ul>
                <li class="index"><a href="/index.html">首页</a></li>
                <li class="qc"><a th:href="'/cart/findByVipId/'+${session.viper.vip_id}">购物车</a></li>
                <li class="qc"><a th:href="'/order/findByVipId/'+${session.viper.vip_id}">我的订单</a></li>
                <li class="qc last"><a href="#">个人中心</a></li>
            </ul>

        </div>
    </div>


</div>


<div class="shopMainbg">

    <div th:each="categories:${list}">
        <div class="am-container ">
            <div class="shopTitle ">
                <h4 th:text="${categories.name}"></h4>
                <h3 th:text="${categories.name}"></h3>

                <span class="more ">
                    <a class="more-link " th:href="'/product/findByCategoryId/0/'+${categories.c_id}+'/1'">更多</a>
                        </span>
            </div>
        </div>


        <div class="am-g am-g-fixed flood method3 ">
            <ul class="am-thumbnails " th:each="products:${categories.products}">

                <li>
                    <div class="list ">
                        <a th:href="'/product/findById/'+${products.product_id}">
                            <img  th:src="'/product/'+${products.product_id}+'.jpg'" style="height: 180px;width: 180px;"/>
                            <div class="pro-title " th:text="${products.name}"></div>
                            <span class="e-price " th:text="'￥'+${#numbers.formatDecimal(products.price,1,'COMMA',2,'POINT')}"></span>
                        </a>
                    </div>
                </li>


            </ul>

        </div>
    </div>
    <div class="footer ">

        <div class="footer-bd ">
            <p>
                <a href="# ">关于我们</a>
                <a href="# ">合作伙伴</a>
                <a href="# ">联系我们</a>
                <a href="# ">网站地图</a>
                <em>© 2015-2025 版权所有. </em>
            </p>
        </div>
    </div>

</div>
</div>

<!--引导 -->


<script>
    window.jQuery || document.write('<script src="/basic/js/jquery-1.9.min.js "><\/script>');
</script>
<script type="text/javascript " src="/basic/js/quick_links.js "></script>
</body>

</html>